<!DOCTYPE html>
<html lang="zh_CN">
<head>
	<meta charset="utf-8">
	<title>成本收益调查问卷</title>
	<link rel="icon" href="favicon.ico" type="image/x-icon">
	<link rel="stylesheet" type="text/css" href="/css/style.css">
	<link rel="stylesheet" href="/css/pure-min.css">
	<script src="/js/jquery-1.10.1.min.js"></script>
	<!-- City Select -->
	<script src="/js/jquery.cityselect.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#administrative").citySelect({
				nodata:"hidden",
				required:false,
				prov:"<? echo set_value('prov'); ?>", 
				city:"<? echo set_value('city'); ?>", 
				dist:"<? echo set_value('dist'); ?>"
			});
		});
	</script>
	<style type="text/css">
	#container{
	margin: 10px auto 10px auto;
	border: 1px solid #D0D0D0;
	-webkit-box-shadow: 0 0 8px #D0D0D0;
	width: 700px;
	}
	</style>
}
</head>
<body>
<div id="container">
<h1 class="header">葡萄园基本情况</h1>
<div id="body">
	<? 
		$form_attributes = array(
			'class' => 'pure-form',
			'action' => '/survey',
			'method' => 'POST');
		echo form_open('survey', $form_attributes); 
	?>
		<div class="q-div" id="administrative">
			<div class="q-title">请选择葡萄园所在的省、市以及区县</div>
			<div class="pure-g">
				<div class="pure-u-1-2">
					<select class="prov q-select" name="prov"></select>
					<select class="city q-select" name="city" style="display: none;"></select>
					<select class="dist q-select" name="dist" style="display: none;">
						<option value="default">请选择</option>
					</select>
				</div>
				<div class="pure-u-1-2 q-help">
					提示：先选择省（直辖市），再依次选择市和区县
				</div>
			</div>
		</div>

		<div class="q-div" name="location_description">
			<div class="q-title">请填入葡萄园的详细地址</div>
			<div class="pure-g">
				<div class="pure-u-1-2">
					<? $input_location_description = array(
													'name' => 'location_description',
													'value' => trim(set_value('location_description')),
													'class' => 'q-text',
													'id' => 'location_description_input',
													'autocomplete' => 'off',
													'size' => '40');
					echo form_input($input_location_description); ?>
				</div>
				<div class="pure-u-1-2 q-help">
					提示：省市区信息无需重复填写<br>
					<span class="q-example">填写示例：池口镇彭姥岭村（灵峰庄园南）</span>
				</div>
			</div>
		</div>

		<div class="q-div" name="cultivation">
			<div class="q-title">请选择葡萄园栽培类型</div>
			<div class="pure-g">
				<div class="pure-u-1-2">
					<label for="open" class="pure-radio"><input id="open" type="radio" name="type_of_cultivation" value="露地栽培">&nbsp;&nbsp;露地栽培
					</label>
					<label for="protection" class="pure-radio"><input id="protection" type="radio" name="type_of_cultivation" value="设施栽培">&nbsp;&nbsp;设施栽培
					</label>
				</div>
				<div class="pure-u-1-2 q-help">
					<p></p>
				</div>
			</div>
<!-- 露地栽培则隐藏下一题 -->
<script type="text/javascript">
	$(document).ready(function() {
	    $("input[name$='type_of_cultivation']").click(function() {
	        var currentID = $(this).attr('id');
	        if (currentID == 'open') {
		        $("#protection-div").hide();
		    }
		    else {
		        $("#protection-div").show();
		    }
	    });
	});
</script>
		</div>

		<div class="q-div" id="protection-div" style="display:none;">
			<div class="q-title">请选择设施栽培类型</div>
			<div class="pure-g">
				<div class="pure-u-1-4">
				<div class="sub-q">设施功能</div>
					<label for="promoting" class="pure-radio">
						<input id="promoting" type="radio" name="function_of_protection" value="促早栽培">&nbsp;&nbsp;促早栽培
					</label>
					<label for="delay" class="pure-radio">
						<input id="delay" type="radio" name="function_of_protection" value="延迟栽培">&nbsp;&nbsp;延迟栽培
					</label>
					<label for="rain_escape" class="pure-radio">
						<input id="rain_escape" type="radio" name="function_of_protection" value="避雨栽培">&nbsp;&nbsp;避雨栽培
					</label>
				</div>
			<div class="pure-u-1-4">
				<div class="sub-q">设施结构</div>
					<label for="plastic_greenhouse" class="pure-radio">
						<input id="plastic_greenhouse" type="radio" name="structure_of_protection" value="塑料大棚">&nbsp;&nbsp;塑料大棚
					</label>
					<label for="sunlight_greenhouse" class="pure-radio">
						<input id="sunlight_greenhouse" type="radio" name="structure_of_protection" value="日光温室">&nbsp;&nbsp;日光温室
					</label>
					<label for="temp_ctrl_greenhouse" class="pure-radio">
						<input id="temp_ctrl_greenhouse" type="radio" name="structure_of_protection" value="加温温室">&nbsp;&nbsp;加温温室
					</label>
					<label for="simple_canopy" class="pure-radio">
						<input id="simple_canopy" type="radio" name="structure_of_protection" value="简易避雨棚">&nbsp;&nbsp;简易避雨棚
					</label>
			</div>
			<div class="pure-u-1-2 q-help">
				提示：
			</div>
			</div>
		</div>

		<div class="q-div" name="sightseeing">
			<div class="q-title">葡萄园是否有观光、采摘业务</div>
			<div class="pure-g">
				<div class="pure-u-1-2">
					<label for="yes" class="pure-radio"><input id="yes" type="radio" name="is_sightseeing" value="是">&nbsp;&nbsp;是
					</label>
					<label for="no" class="pure-radio"><input id="no" type="radio" name="is_sightseeing" value="否">&nbsp;&nbsp;否
					</label>
				</div>
				<div class="pure-u-1-2">
				</div>
			</div>
		</div>


		<div class="q-div" name="total_area">
			<div class="q-title">葡萄园种植总面积</div>
			<div class="pure-g">
				<div class="pure-u-1-2">
			<? $input_total_area = array(
											'name' => 'total_area',
											'value' => trim(set_value('total_area')),
											'size' => '8',
											'class' => 'q-text',
											'id' => 'total_area_input',
											'autocomplete' => 'off');
				echo form_input($input_total_area); ?>
			亩
			</div>
			<div class="pure-u-1-2"></div>
		</div>
		</div>
<!-- 建园成本 -->
		<div class="q-div" name="vineyard_built_info">
			<div class="q-title">建园情况调研</div>
				<div id="built_in" class="sub-q">
				葡萄园建立年份: 
				<? $input_built_in = array(
												'name' => 'built_in',
												'value' => trim(set_value('built_in')),
												'size' => '5',
												'class' => 'q-text',
												'id' => 'built_in_input',
												'autocomplete' => 'off');
					echo form_input($input_built_in); ?>
				</div>		

			<div class="sub-q" id="vineyard_lifetime">
				葡萄园预计使用年限: 
				<? $input_vineyard_lifetime = array(
												'name' => 'vineyard_lifetime',
												'value' => trim(set_value('vineyard_lifetime')),
												'size' => '5',
												'class' => 'q-text',
												'id' => 'vineyard_lifetime_input',
												'autocomplete' => 'off');
					echo form_input($input_vineyard_lifetime); ?>
			</div>

			<div class="sub-q" id="cost_built_meterials">
				建园物质成本: 
				<? $input_cost_built_meterials = array(
												'name' => 'cost_built_meterials',
												'value' => trim(set_value('cost_built_meterials')),
												'size' => '8',
												'class' => 'q-text',
												'id' => 'cost_built_meterials_input');
					echo form_input($input_cost_built_meterials); ?>
			</div>

			<div class="sub-q" id="cost_built_labor">
				建园人力成本: 
				<? $input_cost_built_labor = array(
												'name' => 'cost_built_labor',
												'value' => trim(set_value('cost_built_labor')),
												'size' => '8',
												'class' => 'q-text',
												'id' => 'cost_built_labor_input');
					echo form_input($input_cost_built_labor); ?>
			</div>
		</div>
<!-- 物质成本 -->
		<div class="q-div" name="current_year_material_input">
			<div class="q-title">本年物质成本投入</div>
		<?php
			// 本年物质成本投入
			$current_year_material_input = array(
				'cost_chemical_fertilizer' => '化肥', 
				'cost_pesticide' => '农药',
				'cost_regulator' => '生长调节剂',
				'cost_organic_fertilizer' => '有机肥',
				'cost_water' => '水费',
				'cost_electric' => '电费',
				'cost_fuel' => '燃油',
				'cost_film' => '农膜',
				'cost_plastic' => '套袋',
				);
			foreach ($current_year_material_input as $key => $value) {
				echo '<div class="sub-q" id="' . $key . '">';
				echo $value . ": ";
				$input = array(
					'name' => $key,
					'value' => trim(set_value($key)),
					'size' => '8',
					'class' => 'q-text',
					'id' => $key."_input"
				 );
				echo form_input($input);
				echo " 元";
				echo "</div>";
			}
		?>
		</div>
<!-- 人工成本 -->
		<div class="q-div" name="current_year_labor_input">
			<div class="q-title">劳动力成本</div>

				<div class="sub-q" id="cost_labor">
				本年雇佣人工费用: 
				<? $input_cost_labor = array(
												'name' => 'cost_labor',
												'value' => trim(set_value('cost_labor')),
												'size' => '8',
												'class' => 'q-text',
												'id' => 'cost_labor_input');
					echo form_input($input_cost_labor); ?> 元
				</div>

			<div class="sub-q" id="local_labor_price">
				当地平均用工价格（每人每天）: 
				<? $input_local_labor_price = array(
												'name' => 'local_labor_price',
												'value' => trim(set_value('local_labor_price')),
												'size' => '5',
												'class' => 'q-text',
												'id' => 'local_labor_price_input');
					echo form_input($input_local_labor_price); ?> 元
			</div>

			<div class="sub-q" id="unpaid_labor">
				自家投入（不支付劳务费用的人工数量）: 
				<? $input_unpaid_labor = array(
												'name' => 'unpaid_labor',
												'value' => trim(set_value('unpaid_labor')),
												'size' => '5',
												'class' => 'q-text',
												'id' => 'unpaid_labor_input');
					echo form_input($input_unpaid_labor); ?> 人
			</div>
		</div>
<!-- 机械租用成本 -->
		<div class="q-div" name="cost_machine_rent">
			<div class="q-title">本年农机的租用费用</div>
			<? $input_cost_machine_rent = array(
											'name' => 'cost_machine_rent',
											'value' => trim(set_value('cost_machine_rent')),
											'size' => '10',
											'class' => 'q-text',
											'id' => 'cost_machine_rent_input');
				echo form_input($input_cost_machine_rent); ?>
			元
		</div>

<!-- 其它成本 -->

		<div class="next-page-button" style="padding:10px;text-align:center;">
			<input type="submit" class="pure-button pure-button-primary" value="下一页">
		</div>
	</form>
</div>